/**
  * Copyright 2019 bejson.com 
  */
package com.xingkeduo.dto.transter.refunddetail;

import com.xingkeduo.dto.OrderDetailResponseDto;
import com.xingkeduo.dto.transter.shop.ShopsDTO;
import com.xingkeduo.utils.DateTimeUtils;
import lombok.Data;

import java.time.LocalDateTime;


@Data
public class ContentRefundDetail {

    private String store_id;
    private String admin_avatar;
    private String admin_name;
    private String store_name;
    private String store_address;
    private String store_img;
    private String pay_type;
    private String pay_price;
    private String coupon_price;
    private String order_no;
    private LocalDateTime appointment_time;
    private String  appointment_date;
    private LocalDateTime paytime;
    private String server_name;
    private String all_price;
    private String reduce_price;
    private String activity_id;
    private String activity_name;
    private String is_change_appointment;
    //是否服务过
    private Boolean had_service;
    //排队号
    private String row_no;
    //验票码
    private String ticket_no;
    private String appointment_admin_name;
    private String appointment_admin_avatar;


    public void covert(OrderDetailResponseDto orderDetailResponseDto, ShopsDTO shopsDTO,String appointment_admin_avatar) {
        if(shopsDTO!=null){
            this.store_id=String.valueOf(shopsDTO.getId());
            this.store_name=shopsDTO.getName();
            this.store_address=shopsDTO.getAddress();
            this.store_img=shopsDTO.getShopsImg();
        }

        this.appointment_admin_avatar = appointment_admin_avatar;
        this.pay_type=orderDetailResponseDto.getPayTypeName();
        this.pay_price = String.valueOf(orderDetailResponseDto.getPayPrice());
        this.coupon_price=String.valueOf(orderDetailResponseDto.getMarketingPrice());
        this.order_no = orderDetailResponseDto.getOrderNo();
        this.appointment_time = orderDetailResponseDto.getAppointmentStartTime();
        this.appointment_date= DateTimeUtils.yyyy_MM_dd(orderDetailResponseDto.getAppointmentStartTime());
        this.paytime=orderDetailResponseDto.getPayTime();
        this.server_name = orderDetailResponseDto.getServiceTypeName();
        this.all_price = String.valueOf(orderDetailResponseDto.getAllPrice());
        this.reduce_price = String.valueOf(orderDetailResponseDto.getActivityPrice());
        this.activity_id=String.valueOf(orderDetailResponseDto.getActivityId());
        this.activity_name="";
        this.is_change_appointment=orderDetailResponseDto.getModifyOnce()?"0":"1";
        this.admin_avatar = orderDetailResponseDto.getAdminAvatar();
        if(orderDetailResponseDto.getServiceDown()){
            this.admin_name=orderDetailResponseDto.getAdminNickName();
        }

        this.appointment_admin_name = orderDetailResponseDto.getAppointmentAdminNickName();
        this.row_no =orderDetailResponseDto.getWaitingLineNo();
        this.ticket_no = orderDetailResponseDto.getTicketCode();
        this.had_service=orderDetailResponseDto.getServeStartTime()==null?false:true;


    }
}